package com.powernode.service;

import com.powernode.domain.Basket;
import com.baomidou.mybatisplus.extension.service.IService;
import com.powernode.model.CartVo;
import com.powernode.vo.CartTotalAmount;

import java.util.List;

/**
* @author 贺
* @description 针对表【basket(购物车)】的数据库操作Service
* @createDate 2024-07-25 12:43:44
*/
public interface BasketService extends IService<Basket> {

    /**
     * 查询会员购物车中商品数量
     * @param openId
     * @return
     */
    Integer queryMemberBasketProdCount(String openId);

    /**
     * 查询会员购物车页面数据
     * @param openId
     * @return
     */
    CartVo queryMemberCartVo(String openId);

    /**
     * 计算购物车中会员选中商品的金额
     * @param basketIdList
     * @return
     */
    CartTotalAmount calculateMemberCheckedBasketTotalAmount(List<Long> basketIdList);

    /**
     * 添加商品到购物车/修改购物车中商品数量
     * @param basket
     * @return
     */
    Boolean changeCartItem(Basket basket);
}
